package cn.tedu.shoot;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;

public class Images {
    public static BufferedImage sky;
    public static BufferedImage bullet;
    public static BufferedImage bossBullet;
    public static BufferedImage[] boss;
    public static BufferedImage[] heros;
    public static BufferedImage[] airs;
    public static BufferedImage[] bairs;
    public static BufferedImage[] bees;
    public static BufferedImage[] bossbom;
    public static BufferedImage shield;
    public static BufferedImage start;
    public static BufferedImage pause;
    public static BufferedImage gameover;

    static {
        sky = readImage("background1.png");
        start = readImage("start.png");
        pause = readImage("pause.png");
        gameover = readImage("gameover.png");
        bullet = readImage("bullet.png");
        bossBullet = readImage("bossbullet.png");
        heros = new BufferedImage[2];
        heros[0] = readImage("hero0.png");
        heros[1] = readImage("hero1.png");
        shield=readImage("shield.png");
        boss = new BufferedImage[3];
        boss[0] = readImage("boss0.png");
        boss[1] = readImage("boss1.png");
        boss[2] = readImage("boss2.png");
        bossbom = new BufferedImage[16];
        for (int i = 0; i < bossbom.length; i++) {
            bossbom[i] = readImage("bossbom" + i + ".png");
        }
        airs = new BufferedImage[5];
        bairs = new BufferedImage[5];
        bees = new BufferedImage[5];
        airs[0] = readImage("airplane.png");
        bairs[0] = readImage("bigairplane.png");
        bees[0] = readImage("bee.png");
        for (int i = 1; i < airs.length; i++) {
            airs[i] = readImage("bom" + i + ".png");
            bairs[i] = readImage("bom" + i + ".png");
            bees[i] = readImage("bom" + i + ".png");
        }


    }

    public static BufferedImage readImage(String fileName) {
        try {
            BufferedImage img = ImageIO.read(FlyingObject.class.getResource(fileName));
            return img;
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException();
        }
    }

    public static void main(String[] args) {
        System.out.println(Images.heros.length);
    }
}
